Human eyes typically have a “color constancy” ability to cope with different lighting conditions. For example, when a white object is illuminated under different light sources, a person can usually perceive the object as white despite the different light sources. However, digital cameras often do not have such a “color constancy” ability. When an image is captured by a digital camera, a light source used for illumination can often cause a white object in the captured image to appear “non-white.” For example, a tungsten light bulb used for illumination can cause a white object to appear yellow or orange in the captured image. In another example, a white object may appear blue or even green in a captured image under a fluorescent bulb. In order to make a white object appear white in a digital image, pixel values of the image can be adjusted to reduce the color distortion caused by the light source of the image. This process of changing the pixel values of the captured image to compensate for the effects of the light source is often referred to as performing white balancing of the image.